from sqlalchemy import *
from migrate import *
from datetime import datetime
from migrate.changeset import *

meta = MetaData(migrate_engine)
Diver = Table('Diver', meta,
  Column('id', Integer, primary_key=True,autoincrement=True),
  Column('firstname', Unicode(120)),
  Column('middlename', Unicode(120)),
  Column('lastname', Unicode(120)),
  Column('nickname',Unicode(120)),
  Column('title', Unicode(120)),
  Column('sex', SmallInteger),
  Column('birthdate', DateTime),
  Column('passport', Unicode(120)),
  Column('address_id',Integer,ForeignKey('Address.id')),
  Column('contact_id',Integer,ForeignKey('Contact.id')),
  Column('user_id', Integer(),ForeignKey('tg_user.user_id')),
)

def upgrade():
    image = Column('image',Unicode(120))
    image.create(Diver)

def downgrade():
    image = Column('image',Unicode(120))
    image.drop(Diver)
